//
//  custonWuLiuTwoView.m
//  Experss
//
//  Created by 嗯，大葱 on 17/8/2.
//  Copyright © 2017年 嗯，大葱. All rights reserved.
//

#import "custonWuLiuTwoView.h"

@implementation custonWuLiuTwoView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5f];
        
     
        [self configureView2];
    }
    return self;
}
- (void)configureView2 {
    UIButton *btn = [UIButton buttonWithType:(UIButtonTypeSystem)];
    btn.frame = CGRectMake(0, 0, kScreen_Width, kView_Height-350);
    btn.backgroundColor = [UIColor clearColor];
    [btn addTarget:self action:@selector(handleRePopView:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:btn];
    
   UIView * bgV = [[UIView alloc] initWithFrame:CGRectMake(0, kView_Height-350, kView_Width, 350)];
    bgV.backgroundColor = [UIColor whiteColor];
    [self addSubview:bgV];
    
    
    //确认购买按钮
    UIButton *buyBtn =[UIButton buttonWithType:(UIButtonTypeCustom)];
    buyBtn.frame = CGRectMake(0, CGRectGetMaxY(bgV.frame)- 50, kView_Width, 50);
    [buyBtn setTitle:@"确定" forState:(UIControlStateNormal)];
    [buyBtn setBackgroundImage:[UIImage imageNamed:@"bg1"] forState:(UIControlStateNormal)];
    [self addSubview:buyBtn];
    
    [buyBtn addTarget:self action:@selector(handleBuyBtnAction:) forControlEvents:(UIControlEventTouchUpInside)];
    
    
    
    
    UILabel *shuomingLB = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, kScreenWidth, 30)];
    shuomingLB.textAlignment = NSTextAlignmentCenter;
    
    shuomingLB.textColor = [UIColor blackColor];
    shuomingLB.text = @"物流说明";
    [bgV addSubview:shuomingLB];
    
    _textV = [[UITextView alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(shuomingLB.frame)+10, kView_Width - 20, 200)];
    _textV.text = @"暂时没有物流信息";
    _textV.font = kFont14;
    _textV.textColor = [UIColor lightGrayColor];
    [bgV addSubview:_textV];
    
    
    
    
    
    
}
//确认购买的按钮点击事件
- (void)handleBuyBtnAction :(UIButton *)sender {
    if(self.delegate && [self.delegate respondsToSelector:@selector(sureWuLiuView:)])
    {
        [self.delegate sureWuLiuView:sender];
    }
}
//回收视图
- (void)handleRePopView:(UIButton *)sender {
    
    if(self.delegate && [self.delegate respondsToSelector:@selector(rePopWuLiuView:)])
    {
        [self.delegate rePopWuLiuView:sender];
    }
}
@end
